import React, { useRef } from 'react';
import UploadComp from './components/upload';
import UploadList from './components/uploadList';
import { PageContainer } from '@ant-design/pro-components';

interface ChildComponentHandle {
  refresh: () => void;
}

const uploadPage: React.FC = () => {
  const childRef = useRef<ChildComponentHandle>(null);

  const handleUpload = () => {
    if (childRef.current) {
      childRef.current.refresh(); // 调用子组件的方法
    }
  };

  return (
    <PageContainer>
      <UploadComp onUpload={handleUpload} />
      <UploadList ref={childRef} />
    </PageContainer>
  );
};

export default uploadPage;
